package com.cyanite.playlv2api.types;

import com.cyanite.playlv2api.util.ParcelUtils;

import android.os.Parcel;
import android.os.Parcelable;

public class Tip implements PlayLv2Type, Parcelable {

    private String mPostDate;
    private String mDistance;
    private String mId;
    private String mStatus;
    private String mShout;
    private String mUserName;
    private String mUserId;
    private String mUserPhoto;
    private String mTripId;
    private String mTripName;
    private Venue mVenue;

    public Tip() {
    }

    private Tip(Parcel in) {
        mPostDate = ParcelUtils.readStringFromParcel(in);
        mDistance = ParcelUtils.readStringFromParcel(in);
        mId = ParcelUtils.readStringFromParcel(in);

        mStatus = ParcelUtils.readStringFromParcel(in);
        mShout = ParcelUtils.readStringFromParcel(in);
        mUserId = ParcelUtils.readStringFromParcel(in);
        mUserName = ParcelUtils.readStringFromParcel(in);
        mUserPhoto = ParcelUtils.readStringFromParcel(in);
        mTripId = ParcelUtils.readStringFromParcel(in);
        mTripName = ParcelUtils.readStringFromParcel(in);

        if (in.readInt() == 1) {
            mVenue = in.readParcelable(Venue.class.getClassLoader());
        }
    }

    public static final Parcelable.Creator<Tip> CREATOR = new Parcelable.Creator<Tip>() {
        public Tip createFromParcel(Parcel in) {
            return new Tip(in);
        }

        @Override
        public Tip[] newArray(int size) {
            return new Tip[size];
        }
    };

    public String getUserName() {
        return mUserName;
    }

    public void setUserName(String name) {
        mUserName = name;
    }

    public String getUserId()  {
        return mUserId;
    }

    public void setUserId(String id)  {
        mUserId = id;
    }

    public String getUserPhoto() {
        return mUserPhoto;
    }

    public void setUserPhoto(String photo) {
        mUserPhoto = photo;
    }

    public String getTripName() {
        return mTripName;
    }

    public void setTripName(String name) {
        mTripName = name;
    }

    public String getTripId()  {
        return mTripId;
    }

    public void setTripId(String id)  {
        mTripId = id;
    }

    public String getPostDate() {
        return mPostDate;
    }

    public void setPostDate(String date) {
        mPostDate = date;
    }

    public String getDistance() {
        return mDistance;
    }

    public void setDistance(String distance) {
        mDistance = distance;
    }

    public String getId() {
        return mId;
    }

    public void setId(String id) {
        mId = id;
    }

    public String getShout() {
        return mShout;
    }

    public void setShout(String shout) {
        mShout = shout;
    }

    public Venue getVenue() {
        return mVenue;
    }

    public void setVenue(Venue venue) {
        mVenue = venue;
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        ParcelUtils.writeStringToParcel(out, mPostDate);
        ParcelUtils.writeStringToParcel(out, mDistance);
        ParcelUtils.writeStringToParcel(out, mId);

        ParcelUtils.writeStringToParcel(out, mStatus);
        ParcelUtils.writeStringToParcel(out, mShout);
        ParcelUtils.writeStringToParcel(out, mUserId);
        ParcelUtils.writeStringToParcel(out, mUserName);
        ParcelUtils.writeStringToParcel(out, mUserPhoto);

        if (mVenue != null) {
            out.writeInt(1);
            out.writeParcelable(mVenue, flags);
        } else {
            out.writeInt(0);
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
